package com.guosheng.lambda;

import java.util.stream.Stream;

public class LambdaInstanceMethod {

    public LambdaInstanceMethod(){
        System.out.println("我是构造方法");
    }

    public void test(){
        System.out.println("我是普通的方法");
    }

    public static void twoStaticMethod(){
        System.out.println("我是静态方法");
    }

    public static void main(String[] args){
        TestOne to = new TestOne() {
            @Override
            public void test() {
                System.out.println("匿名内部类实现");
            }
        };
        to.test();

        TestOne tlo = () -> {
            System.out.println("lambda 实现");
        };
        tlo.test();

        //TestOne.test(LambdaInstanceMethod::new);

        Stream.generate(() -> Math.random());

    }
}
